<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>我的</title>
	<link rel="icon" href="img/icon.png" type="image/x-icon"/>
	<link rel="stylesheet" type="text/css" href="css/mui.css"/>
	<link rel="stylesheet" type="text/css" href="css/mui.min.css"/>
	<link rel="stylesheet" type="text/css" href="css/app.css"/>
</head>
<body>
<!-- 顶部菜单 -->
<ul id="top">
	<!-- <li class="addBug back" onclick="mui.back();">返回</li> -->
	<li class="addBug back">&nbsp;</li>
	<li class="addBug">我的设置</li>
	<li class="addBug back">&nbsp;</li>
</ul>
<!-- 数据列表 -->
<div style="height: 20px;"></div>
<table cellspacing="0" class="bugShow">
	<tr>
		<th colspan="2">
		<!-- <th colspan="2" id="adminHead" onclick="jumpToMyHead()"> -->
			<img src="img/icon.png" width="100" height="100">
		</th>
	</tr>
	<tr>
		<th colspan="2" onclick="jumpToMyAdminName()">
			<span id="nickname"></span>
		</th>
	</tr>
	<tr>
		<td class="tl">项目设置</td>
		<td class="btn" onclick="jumpToMyProList()">
			<span id="proName"></span>
		</td>
	</tr>
	<tr>
		<td class="tl">接口域名</td>
		<td class="btn" onclick="jumpToMyDomain()">
			域名-详情
		</td>
	</tr>
	<tr>
		<td class="tl">需 &nbsp; &nbsp; &nbsp; 求</td>
		<td class="btn" onclick="jumpToMyProDetail()">
			项目初始化-详情
		</td>
	</tr>
	<tr>
		<td class="tl">版本升级</td>
		<td class="btn">
			<span id="version"></span>
		</td>
	</tr>
	<tr>
		<td class="tl">管理员</td>
		<td class="btn" onclick="jumpToMyAdmin()">列表详情</td>
	</tr>
	<tr>
		<td class="tl">登陆</td>
		<td class="btn">
			<div id="tologin" onclick="jumpToLogin()">
				未登陆？去登陆
			</div>
			<div id="tologout" onclick="setLogout()">
				已登陆？去退出
			</div>
		</td>
	</tr>
</table>
<div style="height: 50px;"></div>
<!-- 底部菜单 -->
<ul id="foot">
	<li class="noclick" onclick="jumpToIndex()">BUG</li>
	<li class="noclick" onclick="jumpToHistory()">历史</li>
	<li class="noclick" onclick="jumpToMore()">更多</li>
	<li>我的</li>
</ul>
</body>
</html>


<script type="text/javascript" src="js/mui.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript">
	//数据接口
	(function($, owner) {
		// var nickName = '管理员昵称';  //默认昵称
		// var proName = '美策服装';  //默认项目
		// var version = 'V1.01';
		// var adminInfo = cacheGet(adminInfoKey);
		// mui('#nickname')[0].innerHTML = nickName;
		// mui('#proName')[0].innerHTML = proName;
		// mui('#version')[0].innerHTML = version;
		// var domain = getDomain();
		// console.log(domain)
		// mui.ajax(domain+'/app/project/index',{
		// 	data:{
		// 		//
		// 	},
		// dataType:'json',//服务器返回json格式数据
		// type:'post',//HTTP请求类型
		// timeout:10000,//超时时间设置为10秒；
		// // headers:{'Content-Type':'application/json'},
		// headers:{'Content-Type':'application/x-www-form-urlencoded'}, 
		// async: true,  //async: true || false, // 异步 || 同步
		// crossDomain: true,  //强制跨域
		// // 	success:function(data){
		// 		console.log('OK');
		// 	},
		// 	error:function(xhr,type,errorThrown){
				// // console.log('网络错误');
				// mui.toast(xhr+type+'网络错误！',{
				// 	duration:'long', type:'div',
				// });
		// 	}
		// });
		getAdminInfo();
		getProInfo();
		getAppVersion();
		isLogin();
	}(mui, window.app = {}));
	//用户信息获取
	function getAdminInfo(){
		var nickName = '管理员昵称';  //默认昵称
		var adminInfo = cacheGet(adminInfoKey);
		if (adminInfo && adminInfo.adminName) {
			nickName = adminInfo.adminName;
		}
		mui('#nickname')[0].innerHTML = nickName;
	}
	//项目信息
	function getProInfo(){
		var proName = '?美策服装?';
		var proInfo = cacheGet(proInfoKey);
		if (proInfo && proInfo.proName) {
			proName = proInfo.proName;
		}
		mui('#proName')[0].innerHTML = proName;
	}
	//APP版本
	function getAppVersion(){
		var appVersion = cacheGet(appVersionKey);
		if (!appVersion) { appVersion = '1.01'; }
		mui("#version")[0].innerHTML = appVersion;
	}
	//登陆判断
	function isLogin(){
		var token = cacheGet(adminTokenKey);
		if (!token) {
			mui("#tologin")[0].style.display = "block";
			mui("#tologout")[0].style.display = "none";
		} else {
			mui("#tologin")[0].style.display = "none";
			mui("#tologout")[0].style.display = "block";
		}
	}
	//退出登陆
	function setLogout(){
		// var token = cacheGet(adminTokenKey);
		// var adminInfo = cacheGet(adminInfoKey);
		cacheDel(adminTokenKey);
		cacheDel(adminInfoKey);
		//成功提示
		mui.toast('退出成功！',{ 
			duration:'long', type:'div',
		});
		//页面跳转至登陆
		setTimeout(function(){
			jumpToMyLogin();
		}, 2000);
	}
</script>